home *** CD-ROM | disk | FTP | other *** search
/ NetNews Offline 2 / NetNews Offline Volume 2.iso / news / comp / lang / c-part2 / 12031 < prev    next >
Encoding:
Internet Message Format  |  1996-08-05  |  835 b 

  1. Path: li.net!jeremy
  2. From: jeremy@newshost.li.net (Jeremy Markman)
  3. Newsgroups: comp.lang.c
  4. Subject: Re: string search?
  5. Date: 28 Mar 1996 14:29:15 GMT
  6. Organization: LI Net (Long Island Network)
  7. Message-ID: <4je7nr$91u@linet06.li.net>
  8. References: <4jbmtk$78k@dfw-ixnews3.ix.netcom.com>
  9. NNTP-Posting-Host: linet04.li.net
  10. X-Newsreader: TIN [version 1.2 PL2]
  11.  
  12. Ricardo Mor (rmor1@ix.netcom.com) wrote:
  13. :     How can I search for a string of characters within another string?
  14. : for example..
  15.  
  16. Which compiler are you using?  Borland comes with a library function 
  17. strstr() that will do just that.  I don't know if other compilers have 
  18. such a function...
  19.  
  20. useage:
  21. char *strstr(char *string1, char *string2)
  22.  
  23. will return a pointer in string1 where the first occurrence of string2 
  24. begins.  will return NULL if string2 does not occur in string1.
  25.